package c_025;

import java.util.Queue;
import java.util.concurrent.ConcurrentLinkedQueue;
/*
* An unbounded thread-safe queue based on linked nodes.+
* This queue orders elements FIFO (first-in-first-out).
 * */

public class T04_ConcurrentQueue {
    public static void main(String[] args) {
        Queue<String> strs=new ConcurrentLinkedQueue<>();

        for (int i = 0; i < 10; i++) {
            strs.offer("a"+i);
        }

        System.out.println(strs);

        System.out.println(strs.size());

        System.out.println(strs.poll());
        System.out.println(strs.size());

        System.out.println(strs.peek());
        System.out.println(strs.size());

        //双端队列Deque
    }
}
